//
//  RVHotelOrderListCell.swift
//  AirTravel
//
//  Created by apple on 2021/11/17.
//

import UIKit
import Kingfisher
class RVHotelOrderListCell: UITableViewCell {

    
    @IBOutlet weak var imgView: UIImageView!
    
    @IBOutlet weak var nameLabel: UILabel!
    
    @IBOutlet weak var statusLabel: UILabel!

    @IBOutlet weak var descLabel: UILabel!

    @IBOutlet weak var timeLabel: UILabel!

    @IBOutlet weak var priceLabel: UILabel!

    @IBOutlet weak var payBtn: UIButton!
    
    @IBOutlet weak var box: UIView!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        box.layer.cornerRadius=6
        box.layer.masksToBounds=true
        imgView.layer.cornerRadius=6
        imgView.layer.masksToBounds=true
        payBtn.layer.cornerRadius=15
        payBtn.layer.masksToBounds=true
        payBtn.layer.borderWidth = 1
        payBtn.layer.borderColor = UIColor(hexString: "#BBBBBB").cgColor

    }

    
    func bind(hotel: RVHotelOrderList){
        
        nameLabel.text = hotel.hotelName
        statusLabel.text = hotel.statusName
        descLabel.text = hotel.bookNum + "间" + hotel.hotelRoomName
        timeLabel.text = hotel.arriveTime + " - " + hotel.leaveTime
        priceLabel.text = "总价: ¥" + hotel.payPrice
        
        guard let urlString = hotel.hotel_image_list.first?.ImageUrl else {
            return
        }
        let url = URL(string: urlString)
        imgView.kf.setImage(with: url)
        
    }
    
    @IBAction func clickPayBtn(_ sender: UIButton) {
        
    }
}
